//
//  NSString+ITTAdditions.m
//  TestDemo
//
//  Created by zll on 15-3-31.
//  Copyright (c) 2015年 hope. All rights reserved.
//

#import "NSString+ITTAdditions.h"

@implementation NSString (ITTAdditions)

//在字符串分类中添加一个判断是否以特定字符串开头的方法
- (BOOL)isStartWithString:(NSString *)string {
    if (string == nil || [string length] == 0) {
        return NO;
    }
    
    NSInteger len = [string length];
    if ([self length] < len) {
        return NO;
    }
    
    NSString *str = [self substringToIndex:len];
    if ([str isEqualToString:string]) {
        return YES;
    }
    
    return NO;
}

@end
